<html>
  <head>
    <title>Product Envy</title>
    <link type="text/css" rel="stylesheet" href="/css/main.css" />
    <script type="text/javascript" src="/js/jquery.js"></script>
    <script type="text/javascript">

        jQuery.noConflict();
        
        var currentdiv = null;
        
        function parse()
        {
            var ptxt = jQuery("#talk").val();
            if(ptxt != null)
            {
                window.location = '/?{{ params }}&p='+escape(ptxt);
            }
            else
            {
                //alert("Please specify a product using square brackets. Ex: 'I love [Apple]!'");
            }
        }
        
    </script>
  </head>
  <body>
    <form action="" method="post">
      <div class="xsmall">
        <label class="title">What do you wanna talk about?</label><br />
        <input id="talk" name="talk" length="80">
        <input id="btnsubmit" type="button" value="submit" onclick="parse();" />
    </div>
    <div class="example">

    {% if products %}
        {% for product in products %}
          <div class="product">
          {% if product.thumbnailImage %}
              <div class="imgfloatl" style="cursor:pointer;cursor:hand;" onclick="chooseProduct({{product.productId}})"'>
              <img alt="{{ product.name }}" title="{{ product.name }}" src="{{ product.thumbnailImage }}" />
              </div>
          {% endif %}
              {{ product.name }}<br/>by {{ product.artistName }}<br/>${{ product.regularPrice }}
              <div id="trackdiv{{product.productId}}"></div>
              <div class="xsmallgrey"><i>{{ product.text }}</i></div>
          </div>    
        {% endfor %}
        
    {% else %}
        <div class="product"><b>Nothing related found.</b></div>
    {% endif %}

    {% for error in errors %}
        error: {{ error.desc }}        
    {% endfor %}
    </div>
    </form>

  </body>
</html>
